<?php
	require_once (dirname(__FILE__) . "/../../config.php");
	$content = getUpdateStatus();
	outPutXml($content);
  	function getUpdateStatus(){
  		$content = "";
  		if(isset($_GET['mac'])){
	  	$sql1="select * from zy_equipment where MacAddress='".$_GET['mac']."'";
	  	$rss = mysql_query($sql1);
	  	$rows = mysql_fetch_array($rss);
 
  		$sql="select * from zy_updatestatus where user_id='".$rows['updater']."'";
  		$rs = mysql_query($sql);
  		$row = mysql_fetch_array($rs);
  		$content.= "<result>\n";
		$content.= "<routeupdate>".$row['routeupdate']."</routeupdate>\n";
		$content.= "<wifiupdate>0</wifiupdate>\n";
		$content.= "<dnsupdate>0</dnsupdate>\n";
		$content.= "<vpnupdate>0</vpnupdate>\n";
		$content.= "</result>\n";
	}	
  	return $content;
  } 
  
    function outPutXml($content) {
	header("Content-type:text/xml");
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n";
	echo "<netcuberesult>\n";
	echo $content;
	echo "</netcuberesult>";
	die();
}
?>
